\(\int \frac {\log (\frac {1+x}{-1+x})}{x^2} \, dx\) [249]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 35 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=2 \log \left (-\frac {x}{1-x}\right )-\frac {(1+x) \log \left (-\frac {1+x}{1-x}\right )}{x} \]

[Out]

2*ln(-x/(1-x))-(1+x)*ln((-1-x)/(1-x))/x

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {2553, 2351, 31} \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=2 \log \left (-\frac {x}{1-x}\right )-\frac {(x+1) \log \left (-\frac {x+1}{1-x}\right )}{x} \]

[In]

Int[Log[(1 + x)/(-1 + x)]/x^2,x]

[Out]

2*Log[-(x/(1 - x))] - ((1 + x)*Log[-((1 + x)/(1 - x))])/x

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2351

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x_Symbol] :> Simp[x*(d + e*x^r)^(q +
 1)*((a + b*Log[c*x^n])/d), x] - Dist[b*(n/d), Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q,
r}, x] && EqQ[r*(q + 1) + 1, 0]

Rule 2553

Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m
_.), x_Symbol] :> Dist[b*c - a*d, Subst[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m +
 2)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && NeQ[b*c - a*d, 0] && Inte
gerQ[m] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = -\left (2 \text {Subst}\left (\int \frac {\log (x)}{(-1-x)^2} \, dx,x,\frac {1+x}{-1+x}\right )\right ) \\ & = -\frac {(1+x) \log \left (-\frac {1+x}{1-x}\right )}{x}-2 \text {Subst}\left (\int \frac {1}{-1-x} \, dx,x,\frac {1+x}{-1+x}\right ) \\ & = 2 \log \left (-\frac {x}{1-x}\right )-\frac {(1+x) \log \left (-\frac {1+x}{1-x}\right )}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.86 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=2 \log (x)-\frac {\log \left (\frac {1+x}{-1+x}\right )}{x}-\log \left (1-x^2\right ) \]

[In]

Integrate[Log[(1 + x)/(-1 + x)]/x^2,x]

[Out]

2*Log[x] - Log[(1 + x)/(-1 + x)]/x - Log[1 - x^2]

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.83

method result size
risch \(-\frac {\ln \left (\frac {x +1}{-1+x}\right )}{x}+2 \ln \left (x \right )-\ln \left (x^{2}-1\right )\) \(29\)
parts \(-\frac {\ln \left (\frac {x +1}{-1+x}\right )}{x}-\ln \left (-1+x \right )+2 \ln \left (x \right )-\ln \left (x +1\right )\) \(33\)
parallelrisch \(\frac {2 \ln \left (x \right ) x -2 \ln \left (-1+x \right ) x -x \ln \left (\frac {x +1}{-1+x}\right )-\ln \left (\frac {x +1}{-1+x}\right )}{x}\) \(43\)
derivativedivides \(2 \ln \left (2+\frac {2}{-1+x}\right )-\frac {2 \ln \left (1+\frac {2}{-1+x}\right ) \left (1+\frac {2}{-1+x}\right )}{2+\frac {2}{-1+x}}\) \(46\)
default \(2 \ln \left (2+\frac {2}{-1+x}\right )-\frac {2 \ln \left (1+\frac {2}{-1+x}\right ) \left (1+\frac {2}{-1+x}\right )}{2+\frac {2}{-1+x}}\) \(46\)

[In]

int(ln((x+1)/(-1+x))/x^2,x,method=_RETURNVERBOSE)

[Out]

-1/x*ln((x+1)/(-1+x))+2*ln(x)-ln(x^2-1)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.83 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=-\frac {x \log \left (x^{2} - 1\right ) - 2 \, x \log \left (x\right ) + \log \left (\frac {x + 1}{x - 1}\right )}{x} \]

[In]

integrate(log((1+x)/(-1+x))/x^2,x, algorithm="fricas")

[Out]

-(x*log(x^2 - 1) - 2*x*log(x) + log((x + 1)/(x - 1)))/x

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.57 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=2 \log {\left (x \right )} - \log {\left (x^{2} - 1 \right )} - \frac {\log {\left (\frac {x + 1}{x - 1} \right )}}{x} \]

[In]

integrate(ln((1+x)/(-1+x))/x**2,x)

[Out]

2*log(x) - log(x**2 - 1) - log((x + 1)/(x - 1))/x

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.91 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=-\frac {\log \left (\frac {x + 1}{x - 1}\right )}{x} - \log \left (x + 1\right ) - \log \left (x - 1\right ) + 2 \, \log \left (x\right ) \]

[In]

integrate(log((1+x)/(-1+x))/x^2,x, algorithm="maxima")

[Out]

-log((x + 1)/(x - 1))/x - log(x + 1) - log(x - 1) + 2*log(x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 103 vs. \(2 (29) = 58\).

Time = 0.35 (sec) , antiderivative size = 103, normalized size of antiderivative = 2.94 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=\frac {2 \, \log \left (\frac {\frac {\frac {x + 1}{x - 1} + 1}{\frac {x + 1}{x - 1} - 1} + 1}{\frac {\frac {x + 1}{x - 1} + 1}{\frac {x + 1}{x - 1} - 1} - 1}\right )}{\frac {x + 1}{x - 1} + 1} - 2 \, \log \left (\frac {{\left | x + 1 \right |}}{{\left | x - 1 \right |}}\right ) + 2 \, \log \left ({\left | \frac {x + 1}{x - 1} + 1 \right |}\right ) \]

[In]

integrate(log((1+x)/(-1+x))/x^2,x, algorithm="giac")

[Out]

2*log((((x + 1)/(x - 1) + 1)/((x + 1)/(x - 1) - 1) + 1)/(((x + 1)/(x - 1) + 1)/((x + 1)/(x - 1) - 1) - 1))/((x
 + 1)/(x - 1) + 1) - 2*log(abs(x + 1)/abs(x - 1)) + 2*log(abs((x + 1)/(x - 1) + 1))

Mupad [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.80 \[ \int \frac {\log \left (\frac {1+x}{-1+x}\right )}{x^2} \, dx=2\,\ln \left (x\right )-\ln \left (x^2-1\right )-\frac {\ln \left (\frac {x+1}{x-1}\right )}{x} \]

[In]

int(log((x + 1)/(x - 1))/x^2,x)

[Out]

2*log(x) - log(x^2 - 1) - log((x + 1)/(x - 1))/x